1. Field of the Invention
The present invention relates to an apparatus that detects an object from an input image, and a method thereof.
2. Description of the Related Art
In conventional digital cameras and printers, a technique has been discussed which detects a specific object such as a person and a face in an input image and perform processing suitable for the detected object. An example of the technique includes processing for detecting a face and correcting a skin color.
Various types of methods for performing face detection processing are discussed. For example, a following method is discussed in “Robust Real-time Object Detection”, SECOND INTERNATIONAL WORKSHOP ON STATISTICAL AND COMPUTATIONAL THEORIES OF VISION, by P. Viola and M. Jones, Jul. 13, 2001. More specifically, the method uses weak discriminators that perform discrimination of whether there is a possibility that input data includes a face based on different characteristics, and when all the weak discriminators discriminate that the input data is positive, it is determined that a human face has been detected.
According to the above described method, all weak discriminators are connected in series. In discrimination processing by each of the weak discriminators (hereafter, also referred to as processing on each stage), when the weak discriminator discriminates that there is a possibility that the input data includes a face, the processing proceeds to a next stage. When the weak discriminator discriminates that there is no possibility that the input data includes a face, the subsequent processing is terminated. When the discrimination processing is performed through all stages, it is determined that the input data includes a face. Since the discrimination performed in each of the weak discriminators is simple and when a face is not included in the input image, most discrimination processing is stopped at earlier stages, so that the processing can be performed at high speed as a whole.
When what size of face is present at what position in an image is not known, the same detection processing is performed on each region while changing a position and size of an image region, which is a discrimination target.
When the above described weak discriminators are used as hardware, since only a difference among discriminators is dictionary data to be referred to for discrimination, a circuit used for discrimination can be shared. On the other hand, the dictionary data for all stages may be prepared in an internal memory such as a random access memory (RAM). Or, since processing of each stage is sequentially performed, the dictionary data used for each stage may be read from an external memory to the internal memory.
However, configurations for storing the above described dictionary data for all the stages in the internal memory and storing the dictionary data only for one stage in the internal memory have each problem as described below.
First, since the configuration for storing the dictionary data for all the stages in the internal memory has no necessity of processing for reading the dictionary data in each stage, the processing can be performed at high speed. However, since a size of the internal memory necessary for the dictionary data is increased, a size of the circuit is also increased.
On the other hand, in the configuration for storing the dictionary data for only one stage in the internal memory and loading necessary dictionary data from the external memory for each stage processing, since only small capacity of memory is necessary, the size of the circuit can be reduced. However, since the dictionary data is frequently loaded, a processing speed is slow down.